
clear mact_fnames
mact_fnames{1}='mouse_monitor10.bin';
mact_fnames{2}='mouse_monitor11.bin';
mact_fnames{3}='mouse_monitor12.bin';
mact_fnames{4}='mouse_monitor13.bin';
mact_fnames{5}='mouse_monitor14.bin';
mact_fnames{6}='mouse_monitor15.bin';
mact_fnames{7}='mouse_monitor16.bin';


aa=[];
for ind=1:length(mact_fnames)
fi=fopen(['C:\tmpdata\' mact_fnames{ind}],'r','ieee-be');
bb=fread(fi,inf,'double');
aa=[aa;bb];
end

figure;
plot((aa(1)+[1:length(aa)/2]/60)/60,24*smooth(aa([2:2:end]),300))
hold on
plot((aa(1)+[1:length(aa)/2]/60)/60,aa([1:2:end])/60,'r')
set(gca,'xtick',[0:4:100])
set(gca,'xticklabel',repmat([24 4 8 12 16 20],[1 5]))

avg_act=zeros(60*24,1);
for ind=1:60*24
    avg_act(ind)=mean(aa(find(aa==ind)+1));
end
figure;
plot([1/60:1/60:24],smooth(avg_act,10))
set(gca,'xtick',[0:4:24])
